#include "paintdevice.h"
#include "paintengine.h"
#include <QRect>

PaintEngine *PaintDevice::paint_engine_ = NULL;

PaintDevice::PaintDevice()
{

}

int PaintDevice::writeText(QRect rect, const QString &text, Color fontColor, Color backColor)
{
    Q_ASSERT(paint_engine_);
    paint_engine_->writeText(rect, text, fontColor, backColor);
    return 0;
}

int PaintDevice::clearRect(QRect rect)
{
    Q_ASSERT(paint_engine_);
    paint_engine_->clearRect(rect);
    return 0;
}

int PaintDevice::clear()
{
    Q_ASSERT(paint_engine_);
    paint_engine_->clear();
    return 0;
}

void PaintDevice::setPaintEngine(PaintEngine *pe)
{
    paint_engine_ = pe;
}
